package com.itany.corejava.code13_jdbc;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年12月13日 9:28
 */
public class Test {
    public static void main(String[] args) {
        B b=new B(23);
        A a=new A("嘻嘻",b);
        System.out.println(a.getB().getId());
    }
}
class A{
    private String name;
    private B b;

    public A(String name, B b) {
        this.name = name;
        this.b = b;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public B getB() {
        return b;
    }

    public void setB(B b) {
        this.b = b;
    }
}
class B{
    private int id;

    public B(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}